Skip to content

Conversation

bmastbergen
Copy link
Collaborator

Commits

    netfilter: nftables: exthdr: fix 4-byte stack OOB write

    jira VULN-35238
    cve CVE-2023-52628
    commit-author Florian Westphal <[email protected]>
    commit fd94d9dadee58e09b49075240fe83423eb1dcd36
    uio: Fix use-after-free in uio_open

    jira VULN-8874
    cve CVE-2023-52439
    commit-author Guanghui Feng <[email protected]>
    commit 0c9ae0b8605078eafc3bea053cc78791e97ba2e2
    selinux: Add boundary check in put_entry()

    jira VULN-70691
    cve CVE-2022-50200
    commit-author Xiu Jianfeng <[email protected]>
    commit 15ec76fb29be31df2bccb30fc09875274cba2776
    ftrace: Fix NULL pointer dereference in is_ftrace_trampoline when ftrace is dead

    jira VULN-70420
    cve CVE-2022-49977
    commit-author Yang Jihong <[email protected]>
    commit c3b0f72e805f0801f05fa2aa52011c4bfc694c44
    misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram()

    jira VULN-65842
    cve CVE-2022-49788
    commit-author Alexander Potapenko <[email protected]>
    commit e5b0d06d9b10f5f43101bd6598b076c347f9295f
    bnxt: prevent skb UAF after handing over to PTP worker

    jira VULN-33930
    cve CVE-2022-48637
    commit-author Jakub Kicinski <[email protected]>
    commit c31f26c8f69f776759cbbdfb38e40ea91aa0dd65
    net: hns3: fix use-after-free bug in hclgevf_send_mbx_msg

    jira VULN-8748
    cve CVE-2021-47596
    commit-author Jie Wang <[email protected]>
    commit 27cbf64a766e86f068ce6214f04c00ceb4db1af4
    posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del()

    jira VULN-136694
    cve CVE-2025-38352
    commit-author Oleg Nesterov <[email protected]>
    commit f90fff1e152dedf52b932240ebbd670d83330eca

Build Log

/home/brett/kernel-src-tree
Running make mrproper...
[TIMER]{MRPROPER}: 12s
x86_64 architecture detected, copying config
'configs/kernel-x86_64-rhel.config' -> '.config'
Setting Local Version for build
CONFIG_LOCALVERSION="-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul"
Making olddefconfig
--
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
Starting Build
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
  SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
  SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
--
  BTF [M] sound/virtio/virtio_snd.ko
  BTF [M] sound/x86/snd-hdmi-lpe-audio.ko
  BTF [M] sound/xen/snd_xen_front.ko
  LD [M]  virt/lib/irqbypass.ko
  BTF [M] virt/lib/irqbypass.ko
[TIMER]{BUILD}: 1011s
Making Modules
  INSTALL /lib/modules/5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+/kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko
  INSTALL /lib/modules/5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+/kernel/arch/x86/crypto/blake2s-x86_64.ko
  INSTALL /lib/modules/5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+/kernel/arch/x86/crypto/camellia-aesni-avx2.ko
  INSTALL /lib/modules/5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+/kernel/arch/x86/crypto/cast6-avx-x86_64.ko
--
  STRIP   /lib/modules/5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+/kernel/virt/lib/irqbypass.ko
  SIGN    /lib/modules/5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+/kernel/sound/virtio/virtio_snd.ko
  SIGN    /lib/modules/5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+/kernel/virt/lib/irqbypass.ko
  SIGN    /lib/modules/5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+/kernel/sound/xen/snd_xen_front.ko
  DEPMOD  /lib/modules/5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+
[TIMER]{MODULES}: 8s
Making Install
sh ./arch/x86/boot/install.sh \
	5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+ arch/x86/boot/bzImage \
	System.map "/boot"
[TIMER]{INSTALL}: 44s
Checking kABI
kABI check passed
Setting Default Kernel to  and Index to 0
Hopefully Grub2.0 took everything ... rebooting after time metrices
[TIMER]{MRPROPER}: 12s
[TIMER]{BUILD}: 1011s
[TIMER]{MODULES}: 8s
[TIMER]{INSTALL}: 44s
[TIMER]{TOTAL} 1093s
Rebooting in 10 seconds

Testing

selftest-5.14.0-284.30.1.el9_2.ciqfips.0.16.1.x86_64.log

selftest-5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+.log

brett@lycia ~/ciq/many-fips92-vulns-9-11-25
 % grep ^ok selftest-5.14.0-284.30.1.el9_2.ciqfips.0.16.1.x86_64.log | wc -l
259
brett@lycia ~/ciq/many-fips92-vulns-9-11-25
 % grep ^ok selftest-5.14.0-bmastbergen_fips-9-compliant_5.14.0-284.30.1_many-vul+.log | wc -l
264

…x_cpu_timer_del()

jira VULN-136694
cve CVE-2025-38352
commit-author Oleg Nesterov <[email protected]>
commit f90fff1

If an exiting non-autoreaping task has already passed exit_notify() and
calls handle_posix_cpu_timers() from IRQ, it can be reaped by its parent
or debugger right after unlock_task_sighand().

If a concurrent posix_cpu_timer_del() runs at that moment, it won't be
able to detect timer->it.cpu.firing != 0: cpu_timer_task_rcu() and/or
lock_task_sighand() will fail.

Add the tsk->exit_state check into run_posix_cpu_timers() to fix this.

This fix is not needed if CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y, because
exit_task_work() is called before exit_notify(). But the check still
makes sense, task_work_add(&tsk->posix_cputimers_work.work) will fail
anyway in this case.

	Cc: [email protected]
	Reported-by: Benoît Sevens <[email protected]>
Fixes: 0bdd2ed ("sched: run_posix_cpu_timers: Don't check ->exit_state, use lock_task_sighand()")
	Signed-off-by: Oleg Nesterov <[email protected]>
	Signed-off-by: Linus Torvalds <[email protected]>
(cherry picked from commit f90fff1)
	Signed-off-by: Brett Mastbergen <[email protected]>
jira VULN-8748
cve CVE-2021-47596
commit-author Jie Wang <[email protected]>
commit 27cbf64

Currently, the hns3_remove function firstly uninstall client instance,
and then uninstall acceletion engine device. The netdevice is freed in
client instance uninstall process, but acceletion engine device uninstall
process still use it to trace runtime information. This causes a use after
free problem.

So fixes it by check the instance register state to avoid use after free.

Fixes: d835524 ("net: hns3: add trace event support for PF/VF mailbox")
	Signed-off-by: Jie Wang <[email protected]>
	Signed-off-by: Guangbin Huang <[email protected]>
	Signed-off-by: David S. Miller <[email protected]>
(cherry picked from commit 27cbf64)
	Signed-off-by: Brett Mastbergen <[email protected]>
jira VULN-33930
cve CVE-2022-48637
commit-author Jakub Kicinski <[email protected]>
commit c31f26c

When reading the timestamp is required bnxt_tx_int() hands
over the ownership of the completed skb to the PTP worker.
The skb should not be used afterwards, as the worker may
run before the rest of our code and free the skb, leading
to a use-after-free.

Since dev_kfree_skb_any() accepts NULL make the loss of
ownership more obvious and set skb to NULL.

Fixes: 83bb623 ("bnxt_en: Transmit and retrieve packet timestamps")
	Reviewed-by: Andy Gospodarek <[email protected]>
	Reviewed-by: Michael Chan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
	Signed-off-by: Jakub Kicinski <[email protected]>
(cherry picked from commit c31f26c)
	Signed-off-by: Brett Mastbergen <[email protected]>
jira VULN-65842
cve CVE-2022-49788
commit-author Alexander Potapenko <[email protected]>
commit e5b0d06

`struct vmci_event_qp` allocated by qp_notify_peer() contains padding,
which may carry uninitialized data to the userspace, as observed by
KMSAN:

  BUG: KMSAN: kernel-infoleak in instrument_copy_to_user ./include/linux/instrumented.h:121
   instrument_copy_to_user ./include/linux/instrumented.h:121
   _copy_to_user+0x5f/0xb0 lib/usercopy.c:33
   copy_to_user ./include/linux/uaccess.h:169
   vmci_host_do_receive_datagram drivers/misc/vmw_vmci/vmci_host.c:431
   vmci_host_unlocked_ioctl+0x33d/0x43d0 drivers/misc/vmw_vmci/vmci_host.c:925
   vfs_ioctl fs/ioctl.c:51
  ...

  Uninit was stored to memory at:
   kmemdup+0x74/0xb0 mm/util.c:131
   dg_dispatch_as_host drivers/misc/vmw_vmci/vmci_datagram.c:271
   vmci_datagram_dispatch+0x4f8/0xfc0 drivers/misc/vmw_vmci/vmci_datagram.c:339
   qp_notify_peer+0x19a/0x290 drivers/misc/vmw_vmci/vmci_queue_pair.c:1479
   qp_broker_attach drivers/misc/vmw_vmci/vmci_queue_pair.c:1662
   qp_broker_alloc+0x2977/0x2f30 drivers/misc/vmw_vmci/vmci_queue_pair.c:1750
   vmci_qp_broker_alloc+0x96/0xd0 drivers/misc/vmw_vmci/vmci_queue_pair.c:1940
   vmci_host_do_alloc_queuepair drivers/misc/vmw_vmci/vmci_host.c:488
   vmci_host_unlocked_ioctl+0x24fd/0x43d0 drivers/misc/vmw_vmci/vmci_host.c:927
  ...

  Local variable ev created at:
   qp_notify_peer+0x54/0x290 drivers/misc/vmw_vmci/vmci_queue_pair.c:1456
   qp_broker_attach drivers/misc/vmw_vmci/vmci_queue_pair.c:1662
   qp_broker_alloc+0x2977/0x2f30 drivers/misc/vmw_vmci/vmci_queue_pair.c:1750

  Bytes 28-31 of 48 are uninitialized
  Memory access of size 48 starts at ffff888035155e00
  Data copied to user address 0000000020000100

Use memset() to prevent the infoleaks.

Also speculatively fix qp_notify_peer_local(), which may suffer from the
same problem.

	Reported-by: [email protected]
	Cc: stable <[email protected]>
Fixes: 06164d2 ("VMCI: queue pairs implementation.")
	Signed-off-by: Alexander Potapenko <[email protected]>
	Reviewed-by: Vishnu Dasa <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
	Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit e5b0d06)
	Signed-off-by: Brett Mastbergen <[email protected]>
…ace is dead

jira VULN-70420
cve CVE-2022-49977
commit-author Yang Jihong <[email protected]>
commit c3b0f72

ftrace_startup does not remove ops from ftrace_ops_list when
ftrace_startup_enable fails:

register_ftrace_function
  ftrace_startup
    __register_ftrace_function
      ...
      add_ftrace_ops(&ftrace_ops_list, ops)
      ...
    ...
    ftrace_startup_enable // if ftrace failed to modify, ftrace_disabled is set to 1
    ...
  return 0 // ops is in the ftrace_ops_list.

When ftrace_disabled = 1, unregister_ftrace_function simply returns without doing anything:
unregister_ftrace_function
  ftrace_shutdown
    if (unlikely(ftrace_disabled))
            return -ENODEV;  // return here, __unregister_ftrace_function is not executed,
                             // as a result, ops is still in the ftrace_ops_list
    __unregister_ftrace_function
    ...

If ops is dynamically allocated, it will be free later, in this case,
is_ftrace_trampoline accesses NULL pointer:

is_ftrace_trampoline
  ftrace_ops_trampoline
    do_for_each_ftrace_op(op, ftrace_ops_list) // OOPS! op may be NULL!

Syzkaller reports as follows:
[ 1203.506103] BUG: kernel NULL pointer dereference, address: 000000000000010b
[ 1203.508039] #PF: supervisor read access in kernel mode
[ 1203.508798] #PF: error_code(0x0000) - not-present page
[ 1203.509558] PGD 800000011660b067 P4D 800000011660b067 PUD 130fb8067 PMD 0
[ 1203.510560] Oops: 0000 [#1] SMP KASAN PTI
[ 1203.511189] CPU: 6 PID: 29532 Comm: syz-executor.2 Tainted: G    B   W         5.10.0 #8
[ 1203.512324] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
[ 1203.513895] RIP: 0010:is_ftrace_trampoline+0x26/0xb0
[ 1203.514644] Code: ff eb d3 90 41 55 41 54 49 89 fc 55 53 e8 f2 00 fd ff 48 8b 1d 3b 35 5d 03 e8 e6 00 fd ff 48 8d bb 90 00 00 00 e8 2a 81 26 00 <48> 8b ab 90 00 00 00 48 85 ed 74 1d e8 c9 00 fd ff 48 8d bb 98 00
[ 1203.518838] RSP: 0018:ffffc900012cf960 EFLAGS: 00010246
[ 1203.520092] RAX: 0000000000000000 RBX: 000000000000007b RCX: ffffffff8a331866
[ 1203.521469] RDX: 0000000000000000 RSI: 0000000000000008 RDI: 000000000000010b
[ 1203.522583] RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8df18b07
[ 1203.523550] R10: fffffbfff1be3160 R11: 0000000000000001 R12: 0000000000478399
[ 1203.524596] R13: 0000000000000000 R14: ffff888145088000 R15: 0000000000000008
[ 1203.525634] FS:  00007f429f5f4700(0000) GS:ffff8881daf00000(0000) knlGS:0000000000000000
[ 1203.526801] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1203.527626] CR2: 000000000000010b CR3: 0000000170e1e001 CR4: 00000000003706e0
[ 1203.528611] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1203.529605] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Therefore, when ftrace_startup_enable fails, we need to rollback registration
process and remove ops from ftrace_ops_list.

Link: https://lkml.kernel.org/r/[email protected]

	Suggested-by: Steven Rostedt <[email protected]>
	Signed-off-by: Yang Jihong <[email protected]>
	Signed-off-by: Steven Rostedt (Google) <[email protected]>
(cherry picked from commit c3b0f72)
	Signed-off-by: Brett Mastbergen <[email protected]>
jira VULN-70691
cve CVE-2022-50200
commit-author Xiu Jianfeng <[email protected]>
commit 15ec76f

Just like next_entry(), boundary check is necessary to prevent memory
out-of-bound access.

	Signed-off-by: Xiu Jianfeng <[email protected]>
	Signed-off-by: Paul Moore <[email protected]>
(cherry picked from commit 15ec76f)
	Signed-off-by: Brett Mastbergen <[email protected]>
jira VULN-8874
cve CVE-2023-52439
commit-author Guanghui Feng <[email protected]>
commit 0c9ae0b

core-1				core-2
-------------------------------------------------------
uio_unregister_device		uio_open
				idev = idr_find()
device_unregister(&idev->dev)
put_device(&idev->dev)
uio_device_release
				get_device(&idev->dev)
kfree(idev)
uio_free_minor(minor)
				uio_release
				put_device(&idev->dev)
				kfree(idev)
-------------------------------------------------------

In the core-1 uio_unregister_device(), the device_unregister will kfree
idev when the idev->dev kobject ref is 1. But after core-1
device_unregister, put_device and before doing kfree, the core-2 may
get_device. Then:
1. After core-1 kfree idev, the core-2 will do use-after-free for idev.
2. When core-2 do uio_release and put_device, the idev will be double
   freed.

To address this issue, we can get idev atomic & inc idev reference with
minor_lock.

Fixes: 57c5f4d ("uio: fix crash after the device is unregistered")
	Cc: stable <[email protected]>
	Signed-off-by: Guanghui Feng <[email protected]>
	Reviewed-by: Baolin Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
	Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit 0c9ae0b)
	Signed-off-by: Brett Mastbergen <[email protected]>
jira VULN-35238
cve CVE-2023-52628
commit-author Florian Westphal <[email protected]>
commit fd94d9d

If priv->len is a multiple of 4, then dst[len / 4] can write past
the destination array which leads to stack corruption.

This construct is necessary to clean the remainder of the register
in case ->len is NOT a multiple of the register size, so make it
conditional just like nft_payload.c does.

The bug was added in 4.1 cycle and then copied/inherited when
tcp/sctp and ip option support was added.

Bug reported by Zero Day Initiative project (ZDI-CAN-21950,
ZDI-CAN-21951, ZDI-CAN-21961).

Fixes: 49499c3 ("netfilter: nf_tables: switch registers to 32 bit addressing")
Fixes: 935b7f6 ("netfilter: nft_exthdr: add TCP option matching")
Fixes: 133dc20 ("netfilter: nft_exthdr: Support SCTP chunks")
Fixes: dbb5281 ("netfilter: nf_tables: add support for matching IPv4 options")
	Signed-off-by: Florian Westphal <[email protected]>
(cherry picked from commit fd94d9d)
	Signed-off-by: Brett Mastbergen <[email protected]>
Copy link
Collaborator

@PlaidCat PlaidCat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@bmastbergen bmastbergen merged commit 327e172 into fips-9-compliant/5.14.0-284.30.1 Sep 12, 2025
3 checks passed
@bmastbergen bmastbergen deleted the bmastbergen_fips-9-compliant/5.14.0-284.30.1/many-vulns-9-11-25 branch September 12, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants